from django.forms import ModelForm

from .models import Topic, Push, Board, BoardCategory, ForumUser, Message

class TopicForm(ModelForm):
    class Meta:
        model = Topic
        fields = ['title', 'content']

class PushForm(ModelForm):
    class Meta:
        model = Push
        fields = ['content', 'attitude']

class BoardForm(ModelForm):
    class Meta:
        model = Board
        fields = ['name', 'showname', 'discription']

class BoardUpdateForm(ModelForm):
    class Meta:
        model = Board
        fields = ['name', 'showname', 'restrict', 'admin_perm', 'user_perm', 'anonymous_perm']

class BoardCategoryForm(ModelForm):
    class Meta:
        model = BoardCategory
        fields = ['name', 'showname', 'discription']

class UserForm(ModelForm):
    class Meta:
        model = ForumUser
        fields = ['username', 'password', 'email']

class MessageForm(ModelForm):
    class Meta:
        model = Message
        fields = ['name', 'content']
